import './assets/main.css';
import { createApp } from 'vue';
import { createPinia } from 'pinia';
import websocket from '@/websocket/login';
import App from './App.vue';
import router from './router';
import { useEquipmentInfoStore } from '@/stores/equipment-info-store';
const app = createApp(App);
app.use(createPinia());
app.use(router);
app.mount('#app');
const store = useEquipmentInfoStore();
const { closeWebsocket } = websocket();
router.beforeEach((to) => {
    if (to.path === '/login') {
        closeWebsocket();
    }
    store.setCurrentId(to.query?.id);
});
